package com.youku.plugins.controlbarV4.view
{
   import flash.display.MovieClip;
   import com.youku.plugins.controlbarV4.view.components.ControlBar;
   import com.youku.interfaces.IPlayerProxy;
   import com.youku.plugins.PluginEventDispather;
   import flash.display.Sprite;
   import com.youku.ExternalProxy;
   import com.youku.GlobalService;
   import com.youku.GlobalServiceKeys;
   import com.youku.events.CoreEvent;
   import com.youku.events.ConductorEvent;
   import com.youku.events.PlayerControlEvent;
   import com.youku.events.PluginEvent;
   import com.youku.plugins.controlbarV4.view.events.VideoBarEvent;
   import com.youku.PlayerConfig;
   import com.youku.interfaces.IRootData;
   import com.youku.plugins.controlbarV4.ControlBarConstant;
   import com.youku.plugins.controlbarV4.view.events.ControlBarEvent;
   import com.youku.utils.BaseUtil;
   
   public class ControlBarMediator extends Object
   {
      
      public function ControlBarMediator(param1:MovieClip, param2:IPlayerProxy, param3:PluginEventDispather) {
         super();
         this._mainMc = param1;
         this._playerProxy = param2;
         this._played = false;
         this._pluginEventDispather = param3;
      }
      
      private var _mainMc:MovieClip;
      
      private var _bar:ControlBar;
      
      private var _playerProxy:IPlayerProxy;
      
      private var _played:Boolean;
      
      private var _pluginEventDispather:PluginEventDispather;
      
      private var _isLightOff:Boolean = false;
      
      public function init() : void {
         this._bar = new ControlBar();
         this._mainMc.addChild(this._bar as Sprite);
         this._bar.init(this._playerProxy);
         this.changeViewByParameters();
         this.addEvents();
      }
      
      public function getViewComponent() : ControlBar {
         return this._bar;
      }
      
      private function get externalProxy() : ExternalProxy {
         return GlobalService.getService(GlobalServiceKeys.EXTERNALINTERFACE_PROXY) as ExternalProxy;
      }
      
      private function addEvents() : void {
         this._playerProxy.addEventListener(CoreEvent.PLAYING,this.onVideoPlaying);
         this._playerProxy.addEventListener(CoreEvent.CONNECT_START,this.onVideoConnectStart);
         this._playerProxy.addEventListener(CoreEvent.PLAY_START,this.onVideoPlayStart);
         this._playerProxy.addEventListener(CoreEvent.JUMP_PLAY,this.onVideoJumpPlay);
         this._playerProxy.addEventListener(CoreEvent.SEEK,this.onVideoSeek);
         this._playerProxy.addEventListener(CoreEvent.PLAY_OVER,this.onVideoPlayOver);
         this._playerProxy.addEventListener(CoreEvent.AUTO_PLAYED,this.onVideoAutoPlayed);
         this._playerProxy.addEventListener(CoreEvent.PAUSE,this.onVideoPause);
         this._playerProxy.addEventListener(CoreEvent.RESUME,this.onVideoResume);
         this._playerProxy.addEventListener(CoreEvent.QUALITY_CHANGED,this.onVideoQualityChanged);
         this._playerProxy.addEventListener(ConductorEvent.STATE_CHANGED,this.onConductorStateChanged);
         this._playerProxy.addEventListener(ConductorEvent.METADATA_UPDATED,this.onConductorMetadataUpdated);
         this._playerProxy.addEventListener(ConductorEvent.ROOTDATA_UPDATED,this.onConductorRootdataUpdated);
         this._playerProxy.addEventListener(PlayerControlEvent.COMMON_RESET,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.CONTROLBAR_SET_VOLUME,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.FULLSCREEN_CHANGED,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.PLAYER_SIZE_CHANGED,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.INFO_RESTORE_LAST,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.INFO_RESTORE_SERVER,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.INFO_JUMP_HEAD,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.INFO_JUMP_HEAD_SETTING,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.INFO_HIGH_QUALITY_HINT,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.INFO_OPEN_WINDOW_HINT,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.INFO_TRIAL,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.CONTROLBAR_CHANGE_COLOR,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.CONTROLBAR_SHOWHIDE,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.CONTROLBAR_ADD_BUTTON_CAPTION,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.CONTROLBAR_ADD_BUTTON_THRRED,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.COMMON_START_TO_PLAY,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.SHOW_READY_TO_PLAY_SCREEN,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PlayerControlEvent.SIDEBAR_SET_LIGHT,this.onPlayerControlEvent);
         this._playerProxy.addEventListener(PluginEvent.AD_ADPOINT_LOADED,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(PluginEvent.INTERACT_INTERACTPOINT_LOADED,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(PluginEvent.AD_SHOW_INSERT_AD_TIP,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(PluginEvent.AD_REQUEST_TO_PLAY,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(PluginEvent.JUMP_SHOW_HINT_TAIL,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(PluginEvent.JUMP_SHOW_HINT_TAIL_SETTING,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(PluginEvent.AD_SHARE_SHOW,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(PluginEvent.AD_SKIP_SHOW,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(PluginEvent.AD_VIP_SHARE_SHOW,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(PluginEvent.ACCELERATE_INFO_SHOW,this.onOtherPluginEvent);
         this._playerProxy.addEventListener(CoreEvent.BUFFER_TEMP_SWITCH_TO_LOW,this.onBufferEvent);
         this._playerProxy.addEventListener(CoreEvent.BUFFER_INSTALL_IKU,this.onBufferEvent);
         this._playerProxy.addEventListener(CoreEvent.BUFFER_PAUSE_IKU,this.onBufferEvent);
         this._playerProxy.addEventListener(CoreEvent.BUFFER_TIMEOUT,this.onBufferEvent);
         this._bar.addEventListener(VideoBarEvent.FULLSCREEN_CHANGED,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.BAR_HIDE,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.BAR_START_HIDE,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.BAR_SHOW,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.DEFER_CHANGED,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.MODE_CHANGED,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.PLAY_PAUSE,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.SOUND_CHANGING,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.SOUND_CHANGED,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.MUTE_CHANGED,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.DRAG_BEGIN,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.DRAGGING,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.DRAG_FINISHED,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.SETTING_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.QUALITY_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.VOICE_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.NEXT_VIDEO_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.PROGRAM_LIST_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.PRE_VIDEO_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.FORWARD_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.BACKWWARD_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.LOGO_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.HEIGHT_CHANGED,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.JUMP_TAIL,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.SWITCH_TO_LOW,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.THREED_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.CAPTION_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.LOOP_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.ROTATE_CLICK,this.onControlBarEvent);
         this._bar.addEventListener(VideoBarEvent.BUY_LINK_CLICK,this.onControlBarEvent);
      }
      
      private function changeViewByParameters() : void {
         if(!this.shouldShowInformationbar)
         {
            this._bar.removeInformation();
         }
         if(!this.shouldShowProgressBarPoint)
         {
            this._bar.removeProgressBarPoint();
         }
      }
      
      private function get shouldShowInformationbar() : Boolean {
         if(this._playerProxy.rootGetData.rootWinType == "index" || this._playerProxy.rootGetData.rootWinType == "adshow")
         {
            return false;
         }
         return true;
      }
      
      private function get shouldShowProgressBarPoint() : Boolean {
         if(this._playerProxy.rootGetData.rootWinType == "index" || this._playerProxy.rootGetData.rootWinType == "adshow")
         {
            return false;
         }
         return true;
      }
      
      private function onConductorMetadataUpdated(param1:ConductorEvent) : void {
         this._bar.updateMetaData();
      }
      
      private function onConductorRootdataUpdated(param1:ConductorEvent) : void {
         var _loc3_:* = NaN;
         var _loc4_:* = NaN;
         var _loc5_:* = NaN;
         var _loc2_:IRootData = PlayerConfig.rootData;
         if(!(_loc2_.skincolor1 == null) && !(_loc2_.skincolor1 == "") && !(_loc2_.skincolor2 == null) && !(_loc2_.skincolor2 == ""))
         {
            _loc3_ = Number("0x" + _loc2_.skincolor1);
            _loc4_ = Number("0x" + _loc2_.skincolor2);
            _loc5_ = _loc2_.skinalpha / 100;
            this._bar.setBackground(_loc3_,_loc4_,_loc5_);
         }
      }
      
      private function onConductorStateChanged(param1:ConductorEvent) : void {
         var _loc2_:String = param1.data as String;
         this._bar.updateStatus(_loc2_);
      }
      
      private function onVideoPlaying(param1:CoreEvent) : void {
         this._bar.changeProgress(param1.data.loadedTime,param1.data.nsTime);
      }
      
      private function onVideoConnectStart(param1:CoreEvent) : void {
         this._bar.enableVideoControl = false;
      }
      
      private function onVideoPlayStart(param1:CoreEvent) : void {
         this._bar.enableVideoControl = true;
      }
      
      private function onVideoJumpPlay(param1:CoreEvent) : void {
      }
      
      private function onVideoSeek(param1:CoreEvent) : void {
      }
      
      private function onVideoPlayOver(param1:CoreEvent) : void {
         this._bar.showPlayOver();
         this._played = false;
      }
      
      private function onVideoAutoPlayed(param1:CoreEvent) : void {
         this._bar.showPause();
      }
      
      private function onVideoPause(param1:CoreEvent) : void {
         var _loc2_:Boolean = param1.data.useraction;
         if(_loc2_)
         {
            this._bar.showPlay();
         }
      }
      
      private function onVideoResume(param1:CoreEvent) : void {
         this._bar.showPause();
      }
      
      private function onVideoQualityChanged(param1:CoreEvent) : void {
         var _loc2_:String = param1.data.quality;
         this._bar.selectQuality(_loc2_);
      }
      
      private function onOtherPluginEvent(param1:PluginEvent) : void {
         var _loc2_:Array = null;
         var _loc3_:Array = null;
         switch(param1.type)
         {
            case PluginEvent.TOOLBOX_DATA_CHANGED:
               this._bar.showInformation(ControlBarConstant.INFOBAR_SETTING_SUCCESS,true);
               break;
            case PluginEvent.AD_ADPOINT_LOADED:
               _loc2_ = param1.data.points;
               this._pluginEventDispather.dispatchEvent(new ControlBarEvent(ControlBarEvent.DRAW_AD_POINTS,_loc2_));
               break;
            case PluginEvent.INTERACT_INTERACTPOINT_LOADED:
               _loc3_ = param1.data as Array;
               this._pluginEventDispather.dispatchEvent(new ControlBarEvent(ControlBarEvent.DRAW_INTERACT_POINTS,_loc3_));
               break;
            case PluginEvent.AD_SHOW_INSERT_AD_TIP:
               this._bar.showInformation(ControlBarConstant.INFOBAR_ENTER_INSERT_AD);
               break;
            case PluginEvent.AD_REQUEST_TO_PLAY:
               this._bar.hideInformation();
               break;
            case PluginEvent.JUMP_SHOW_HINT_TAIL:
               this._bar.showInformation(ControlBarConstant.INFOBAR_JUMP_TAIL,true);
               break;
            case PluginEvent.JUMP_SHOW_HINT_TAIL_SETTING:
               this._bar.showInformation(ControlBarConstant.INFOBAR_JUMP_TAIL_SETTING,true);
               break;
            case PluginEvent.AD_SHARE_SHOW:
               this._bar.showInformation(ControlBarConstant.INFOBAR_AD_SHARE,true);
               break;
            case PluginEvent.AD_SKIP_SHOW:
               this._bar.showInformation(ControlBarConstant.INFOBAR_AD_SKIP,true);
               break;
            case PluginEvent.AD_VIP_SHARE_SHOW:
               this._bar.showInformation(ControlBarConstant.INFOBAR_VIP_SHARE,true);
               break;
            case PluginEvent.ACCELERATE_INFO_SHOW:
               this._bar.showInformation(ControlBarConstant.INFOBAR_ACCELERATE,true);
               break;
         }
      }
      
      private function onBufferEvent(param1:CoreEvent) : void {
         switch(param1.type)
         {
            case CoreEvent.BUFFER_TEMP_SWITCH_TO_LOW:
               this._bar.showInformation(ControlBarConstant.INFOBAR_TEMP_SWITCH_TO_LOW,true);
               break;
            case CoreEvent.BUFFER_INSTALL_IKU:
               this._bar.showInformation(ControlBarConstant.INFOBAR_INSTALL_IKU,true);
               break;
            case CoreEvent.BUFFER_PAUSE_IKU:
               this._bar.showInformation(ControlBarConstant.INFOBAR_PAUSE_IKU,true);
               break;
            case CoreEvent.BUFFER_TIMEOUT:
               this._bar.showInformation(ControlBarConstant.INFOBAR_INTERNET_SLOW,true);
               break;
         }
      }
      
      private function onPlayerControlEvent(param1:PlayerControlEvent) : void {
         var _loc2_:* = NaN;
         var _loc3_:* = false;
         var _loc4_:* = NaN;
         var _loc5_:* = NaN;
         var _loc6_:String = null;
         var _loc7_:String = null;
         var _loc8_:* = NaN;
         var _loc9_:String = null;
         var _loc10_:* = NaN;
         var _loc11_:* = NaN;
         var _loc12_:* = NaN;
         var _loc13_:* = false;
         var _loc14_:String = null;
         switch(param1.type)
         {
            case PlayerControlEvent.COMMON_RESET:
               this._bar.reset();
               break;
            case PlayerControlEvent.COMMON_START_TO_PLAY:
               this._bar.onVideoStartToPlay();
               break;
            case PlayerControlEvent.CONTROLBAR_SET_VOLUME:
               _loc2_ = param1.data.volume;
               this._bar.setVolume(_loc2_);
               break;
            case PlayerControlEvent.FULLSCREEN_CHANGED:
               _loc3_ = param1.data.fullscreen;
               _loc4_ = param1.data.width;
               _loc5_ = param1.data.height;
               this._bar.toggleFullscreen(_loc3_);
               this._bar.setWH(_loc4_,_loc5_);
               _loc6_ = _loc3_?ControlBarConstant.CONTROLBAR_STYLE_DARK:ControlBarConstant.CONTROLBAR_STYLE_LIGHT;
               if(this._isLightOff)
               {
                  if(_loc6_ == ControlBarConstant.CONTROLBAR_STYLE_LIGHT)
                  {
                     _loc6_ = ControlBarConstant.CONTROLBAR_STYLE_DARK;
                  }
               }
               this._bar.setStyle(_loc6_);
               break;
            case PlayerControlEvent.PLAYER_SIZE_CHANGED:
               _loc3_ = param1.data.fullscreen;
               _loc4_ = param1.data.width;
               _loc5_ = param1.data.height;
               this._bar.setWH(_loc4_,_loc5_);
               break;
            case PlayerControlEvent.INFO_JUMP_HEAD:
               this._bar.showInformation(ControlBarConstant.INFOBAR_JUMP_HEAD,true);
               break;
            case PlayerControlEvent.INFO_JUMP_HEAD_SETTING:
               this._bar.showInformation(ControlBarConstant.INFOBAR_JUMP_HEAD_SETTING,true);
               break;
            case PlayerControlEvent.INFO_RESTORE_LAST:
               _loc7_ = "     ";
               _loc8_ = PlayerConfig.startPosition;
               _loc7_ = BaseUtil.formatTime(_loc8_);
               this._bar.showInformation(ControlBarConstant.INFOBAR_RESTORE_LAST,true,{"time":_loc7_});
               break;
            case PlayerControlEvent.INFO_RESTORE_SERVER:
               _loc9_ = "     ";
               _loc8_ = PlayerConfig.startPosition;
               _loc9_ = BaseUtil.formatTime(_loc8_);
               this._bar.showInformation(ControlBarConstant.INFOBAR_RESTORE_SERVER,true,{"time":_loc9_});
               break;
            case PlayerControlEvent.INFO_HIGH_QUALITY_HINT:
               this._bar.showInformation(ControlBarConstant.INFOBAR_HIGH_QUALITY_HINT);
               break;
            case PlayerControlEvent.INFO_TRIAL:
               this._bar.showInformation(ControlBarConstant.INFOBAR_TRIAL,true,param1.data);
               break;
            case PlayerControlEvent.INFO_OPEN_WINDOW_HINT:
               this._bar.showInformation(ControlBarConstant.INFOBAR_OPEN_WINDOW_HINT,true);
               break;
            case PlayerControlEvent.CONTROLBAR_CHANGE_COLOR:
               _loc10_ = Number("0x" + param1.data.boarderColor);
               _loc11_ = Number("0x" + param1.data.innerColor);
               _loc12_ = param1.data.alpha / 100;
               this._bar.setBackground(_loc11_,_loc10_,_loc12_);
               break;
            case PlayerControlEvent.CONTROLBAR_SHOWHIDE:
               _loc13_ = param1.data.show as Boolean;
               this._bar.showBar(_loc13_);
               break;
            case PlayerControlEvent.CONTROLBAR_ADD_BUTTON_THRRED:
               this._bar.showThreedButton();
               break;
            case PlayerControlEvent.CONTROLBAR_ADD_BUTTON_CAPTION:
               this._bar.showCaptionButton();
               break;
            case PlayerControlEvent.SHOW_READY_TO_PLAY_SCREEN:
               this._bar.showReadyToPlay();
               break;
            case PlayerControlEvent.SIDEBAR_SET_LIGHT:
               this._isLightOff = PlayerConfig.rootData.light == "off";
               _loc14_ = this._isLightOff?ControlBarConstant.CONTROLBAR_STYLE_DARK:ControlBarConstant.CONTROLBAR_STYLE_LIGHT;
               this._bar.setStyle(_loc14_);
               break;
         }
      }
      
      private function onControlBarEvent(param1:VideoBarEvent) : void {
         var _loc2_:String = null;
         var _loc3_:String = null;
         var _loc4_:* = false;
         var _loc5_:* = NaN;
         var _loc6_:* = false;
         var _loc7_:* = NaN;
         var _loc8_:* = false;
         var _loc9_:* = NaN;
         switch(param1.type)
         {
            case VideoBarEvent.FULLSCREEN_CHANGED:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CHANGE_FULLSCREEN));
               break;
            case VideoBarEvent.BAR_HIDE:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_HIDE));
               break;
            case VideoBarEvent.BAR_START_HIDE:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_START_HIDE));
               break;
            case VideoBarEvent.BAR_SHOW:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_SHOW));
               break;
            case VideoBarEvent.DEFER_CHANGED:
               _loc2_ = param1.data.fileType;
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CHANGE_QUALITY,{"quality":_loc2_}));
               break;
            case VideoBarEvent.MODE_CHANGED:
               _loc3_ = param1.data.mode;
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CHANGE_SCREEN_MODE,
                  {
                     "mode":_loc3_,
                     "tween":true
                  }));
               break;
            case VideoBarEvent.PLAY_PAUSE:
               _loc4_ = param1.data.pause;
               if(_loc4_)
               {
                  this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_PAUSE));
               }
               else
               {
                  this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_RESUME));
               }
               break;
            case VideoBarEvent.SOUND_CHANGING:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CHANGE_VOLUME,{"volume":param1.data.volume}));
               break;
            case VideoBarEvent.SOUND_CHANGED:
               if(param1.data.record == true)
               {
                  this._playerProxy.fsoProxy.setVolume(param1.data.volume);
               }
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CHANGE_VOLUME,
                  {
                     "volume":param1.data.volume,
                     "userAction":param1.data.userAction
                  }));
               break;
            case VideoBarEvent.MUTE_CHANGED:
               this._playerProxy.fsoProxy.setMute(param1.data.mute);
               break;
            case VideoBarEvent.DRAG_BEGIN:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_DRAG_BEGIN,{"time":param1.data.time}));
               break;
            case VideoBarEvent.DRAGGING:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_DRAG_DRAGGING,{"time":param1.data.time}));
               break;
            case VideoBarEvent.DRAG_FINISHED:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_DRAG_FINISH,{"time":param1.data.time}));
               break;
            case VideoBarEvent.SETTING_CLICK:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_TOOLBOX,{"type":"setting"}));
               break;
            case VideoBarEvent.QUALITY_CLICK:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_TOOLBOX,{"type":"quality"}));
               break;
            case VideoBarEvent.VOICE_CLICK:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_TOOLBOX,{"type":"voice"}));
               break;
            case VideoBarEvent.PRE_VIDEO_CLICK:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CLICK_PRE_VIDEO));
               break;
            case VideoBarEvent.PROGRAM_LIST_CLICK:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CLICK_PROGRAM_LIST));
               break;
            case VideoBarEvent.NEXT_VIDEO_CLICK:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CLICK_NEXT_VIDEO));
               break;
            case VideoBarEvent.BACKWWARD_CLICK:
               _loc5_ = this._playerProxy.playerData.videoNsTime - this._bar.stepTime;
               if(_loc5_ < 0)
               {
                  _loc5_ = 0;
               }
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_DRAG_FINISH,{"time":_loc5_}));
               break;
            case VideoBarEvent.FORWARD_CLICK:
               _loc5_ = this._playerProxy.playerData.videoNsTime + this._bar.stepTime;
               if(_loc5_ > this._playerProxy.playerData.videoTotalTime)
               {
                  _loc5_ = this._playerProxy.playerData.videoTotalTime;
               }
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_DRAG_FINISH,{"time":_loc5_}));
               break;
            case VideoBarEvent.LOGO_CLICK:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CLICK_LOGO));
               break;
            case VideoBarEvent.HEIGHT_CHANGED:
               _loc6_ = param1.data.fullscreen;
               _loc7_ = param1.data.h;
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_HEIGHT_CHANGED,
                  {
                     "cheight":_loc7_,
                     "fullscreen":_loc6_
                  }));
               break;
            case VideoBarEvent.JUMP_TAIL:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_JUMP_TAIL));
               break;
            case VideoBarEvent.SWITCH_TO_LOW:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CHANGE_QUALITY,{"quality":"low"}));
               break;
            case VideoBarEvent.CAPTION_CLICK:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CLICK_CAPTION));
               break;
            case VideoBarEvent.THREED_CLICK:
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CLICK_THREED));
               break;
            case VideoBarEvent.LOOP_CLICK:
               _loc8_ = param1.data.loop;
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CLICK_LOOP,{"loop":_loc8_}));
               break;
            case VideoBarEvent.ROTATE_CLICK:
               _loc9_ = param1.data.angle as Number;
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_CLICK_ROTATE,{"angle":_loc9_}));
               break;
            case VideoBarEvent.BUY_LINK_CLICK:
               if((this._playerProxy.playerData.trialInfo) && (this._playerProxy.rootGetData.rootTrialJS))
               {
                  this.externalProxy.onTrialEnd();
               }
               else
               {
                  this.externalProxy.onTrialLinkClick();
               }
               this._playerProxy.dispatchEvent(new PluginEvent(PluginEvent.CONTROL_BAR_PAUSE));
               break;
         }
      }
   }
}
